﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.Search;

namespace Sharp.ServiceContracts
{
    [ServiceContract]
    public interface IPlatformService : IApplicationServiceContract
    {
        /// <summary>
        /// 保存子系统
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveSubSystem(SubSystemDTO model);

        /// <summary>
        /// 删除子系统
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteSubSystem(Guid[] ids);

        /// <summary>
        /// 获取一条主数据
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        SubSystemDTO GetSubSystemInfo(Guid id);
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<SubSystemDTO> GetSubSystemPaged(PagingFeature pf);
        /// <summary>
        /// 获取接入系统
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IList<SubSystemDTO> GetSubSystems();
        #region MasterData
        /// <summary>
        /// 保存主数据
        /// </summary>
        /// <param name="masterData">主数据</param>
        /// <returns>操作结果</returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveMasterData(MasterDataDTO masterData);

        /// <summary>
        /// 删除主数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteMasterData(Guid[] ids);

        /// <summary>
        /// 获取一条主数据
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        MasterDataDTO GetMasterDataInfo(Guid id);

        /// <summary>
        /// 获取主数据
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IList<MasterDataDTO> GetMasterData();

        /// <summary>
        /// 获取省份数据
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IList<MasterDataDTO> GetProvinceData();

        /// <summary>
        /// 代码项翻译成文字项
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        string Code2Text(string code);

        /// <summary>
        /// 获取主数据分类
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IList<MasterDataDTO> GetMasterDataSort();

        /// <summary>
        /// 获取分页
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<MasterDataDTO> MasterDataGetPaged(PagingFeature pf);
        #endregion

    }
}
